//
//  GRXShoppingCarController.m
//  1-MushroomStreet-自定义tabbar
//
//  Created by xmg on 15/12/31.
//  Copyright © 2015年 grx. All rights reserved.
//

#import "GRXShoppingCarController.h"
#import "GRXShopCarView.h"
#import "GRXProductController.h"
@interface GRXShoppingCarController ()
@property (weak, nonatomic) IBOutlet UIView *backView;


/**购物车货物数组*/
@property (nonatomic,strong)NSMutableArray *productArray;



@end

@implementation GRXShoppingCarController


- (NSArray *)productArray{
    if (_productArray == nil) {
        _productArray = [NSMutableArray array];
        
        [_productArray addObject:@"棉衣"];
        
    }
    return _productArray;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    if (self.productArray.count != 0) {
        
        
        GRXProductController *controller = [[GRXProductController alloc] init];
        [self addChildViewController:controller];
        
        
        self.view = [GRXShopCarView shopCarView];
    }
    
    
    [self setUpView];
   
}

- (void)setUpView{
    self.title = @"购物车";
    self.backView.layer.cornerRadius = self.backView.width * 0.5;
    self.backView.layer.masksToBounds = YES;
    
    
}



- (IBAction)goShopping:(UIButton *)sender {
    
    if (self.productArray.count == 0) {
        
        [self.navigationController popViewControllerAnimated:YES];
    }else {
        NSLog(@"请支付");
    }
}


@end
